<template>
    <div>
        <van-nav-bar  :title="topBarTitle" left-text="返回" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
            <template #right>
                <van-icon name="search" size="18" />
            </template>
        </van-nav-bar>
    </div>
</template>

<script>
    import {
        reactive,
        toRefs,
        ref,
        unref,
        onBeforeMount,
        onMounted,
        onBeforeUpdate,
        onUpdated,
        onBeforeUnmount,
        onUnmounted,
        defineComponent,
        inject,
        provide
    } from 'vue'
    import { useRouter } from 'vue-router'
    import { useStore } from 'vuex';
    import { showToast, showFailToast, showLoadingToast, showSuccessToast } from 'vant';

    export default ({
        name: 'topNavBar',
        props: {
            topBarTitle: String,
            isShowRight:Boolean,
        },
        setup(props, context) {

            const onClickLeft = () => history.back();
            const onClickRight = () => showSuccessToast('按钮');
            const router = useRouter();
            const store = useStore;
            const data = reactive({
                title:props.title,
                isShowRight:props.isShowRight
            })


            return {
                ...toRefs(data),
                router,
                store,
                onClickLeft,
                onClickRight,
            }
        }

    })
</script>

<style>

</style>